package com.liwei.controller;
import com.liwei.beans.Stu;
import com.liwei.services.StuServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;

@Controller
@RequestMapping("/stu")
public class StuController {
    @Autowired
    StuServices stuServices;
    @RequestMapping("getAll.action")
    @ResponseBody
    public ArrayList<Stu> getAll(Model model){
        ArrayList<Stu> all = stuServices.getAll();
        return all;
    }
}
